//Enhanced User Name Dictionary Creator
//By: Ryan McDougall
//3-8-2011
//
// This program creates accurate user name dictionaries for use with brute force
// account auditing tools.
//

#include <cstdlib>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>

using namespace std;

//Components that make up each user name. Schemas can be added
//or modified depending on the need.
struct schema
{
	string component1;
	string component2;
	int  numcomponent;
};

int main()
{
	//loop counter
	int count = 0;	
  
	//Vars for reading in components from files
	schema combo[size];

    //Select input files for schema
	ifstream inputFile1;
	ifstream inputFile2;
	ofstream o_file;

	inputFile1.open("testcomp1.txt");
	inputFile2.open("testcomp2.txt");
	
	o_file.open("output.txt");
	
	//First iteration
	inputFile1 >> combo[count].component1;
	inputFile2 >> combo[count].component2;
	cout << "Creating dictionary...	" << endl;
	
	//Loop to create all possibilities from input files.
	for(int i = 0; i < 26; i++)
	{
      inputFile1 >> combo[count].component1;
      for(int j=0; j <= 50; j++)
      {
        inputFile2 >> combo[j].component2;
        o_file << combo[count].component1 << combo[j].component2 << endl;
      }
      count++;
    }
    

	inputFile1.close();
	inputFile2.close();
	o_file.close();
	
	cout << "Dictionary complete. Open the output.txt file to see results" << endl;

    system("PAUSE");

}

